/* 专业金融主题样式 */

/* ===== CSS变量定义 ===== */
:root {
    /* 主色调 */
    --primary-color: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    
    /* 辅助色 */
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --info-color: #0891b2;
    
    /* 中性色 */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* 字体 */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    
    /* 间距 */
    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-3: 0.75rem;
    --spacing-4: 1rem;
    --spacing-5: 1.25rem;
    --spacing-6: 1.5rem;
    --spacing-8: 2rem;
    --spacing-10: 2.5rem;
    --spacing-12: 3rem;
    
    /* 圆角 */
    --border-radius-sm: 0.375rem;
    --border-radius: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* 过渡动画 */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
}

/* ===== 基础样式重置 ===== */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--gray-700);
    background-color: var(--gray-50);
}

/* ===== 导航栏样式 ===== */
.navbar-financial {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-financial .navbar-brand {
    font-weight: 700;
    font-size: var(--font-size-xl);
    color: white !important;
    transition: var(--transition-fast);
}

.navbar-financial .navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-financial .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: var(--spacing-3) var(--spacing-4);
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
    position: relative;
}

.navbar-financial .nav-link:hover,
.navbar-financial .nav-link.active {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.navbar-financial .dropdown-menu {
    background-color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-2);
    margin-top: var(--spacing-2);
}

.navbar-financial .dropdown-item {
    color: var(--gray-700);
    padding: var(--spacing-3) var(--spacing-4);
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
    font-weight: 500;
}

.navbar-financial .dropdown-item:hover {
    background-color: var(--gray-100);
    color: var(--primary-color);
    transform: translateX(4px);
}

/* 实时状态指示器 */
.real-time-indicator {
    background: linear-gradient(45deg, #10b981, #059669);
    color: white;
    padding: var(--spacing-1) var(--spacing-3);
    border-radius: var(--border-radius-xl);
    font-size: var(--font-size-xs);
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.real-time-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ===== 卡片系统 ===== */
.card-financial {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    overflow: hidden;
}

.card-financial:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* 欢迎横幅 */
.stock-info-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
}

.stock-info-banner .card-body {
    padding: var(--spacing-12) var(--spacing-6);
}

.stock-info-banner .display-4 {
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stock-info-banner .lead {
    font-size: var(--font-size-lg);
    opacity: 0.95;
}

/* 指标卡片增强版 */
.metric-card-enhanced {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    overflow: hidden;
    position: relative;
}

.metric-card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transform: scaleX(0);
    transition: var(--transition-normal);
}

.metric-card-enhanced:hover::before {
    transform: scaleX(1);
}

.metric-card-enhanced:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--primary-light);
}

.metric-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--spacing-4);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-100), var(--gray-50));
    border-radius: var(--border-radius-xl);
    transition: var(--transition-normal);
}

.metric-icon i {
    font-size: 2rem;
    transition: var(--transition-normal);
}

.metric-card-enhanced:hover .metric-icon {
    transform: scale(1.1) rotate(5deg);
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
}

.metric-card-enhanced:hover .metric-icon i {
    color: white !important;
}

/* 悬浮提升效果 */
.hover-lift {
    transition: var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ===== 按钮系统 ===== */
.btn-financial {
    font-weight: 600;
    padding: var(--spacing-3) var(--spacing-6);
    border-radius: var(--border-radius-lg);
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn-financial::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: var(--transition-fast);
}

.btn-financial:hover::before {
    left: 100%;
}

.btn-primary-financial {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border: none;
    color: white;
}

.btn-primary-financial:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-success-financial {
    background: linear-gradient(135deg, var(--success-color), #10b981);
    border: none;
    color: white;
}

.btn-success-financial:hover {
    background: linear-gradient(135deg, #047857, var(--success-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-warning-financial {
    background: linear-gradient(135deg, var(--warning-color), #f59e0b);
    border: none;
    color: white;
}

.btn-warning-financial:hover {
    background: linear-gradient(135deg, #b45309, var(--warning-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-danger-financial {
    background: linear-gradient(135deg, var(--danger-color), #ef4444);
    border: none;
    color: white;
}

.btn-danger-financial:hover {
    background: linear-gradient(135deg, #b91c1c, var(--danger-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===== 数据表格 ===== */
.table-financial {
    background: white;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-financial thead th {
    background: linear-gradient(135deg, var(--gray-100), var(--gray-50));
    border: none;
    font-weight: 600;
    color: var(--gray-700);
    padding: var(--spacing-4);
}

.table-financial tbody tr {
    transition: var(--transition-fast);
}

.table-financial tbody tr:hover {
    background-color: var(--gray-50);
    transform: scale(1.01);
}

.table-financial tbody td {
    padding: var(--spacing-4);
    border-color: var(--gray-200);
}

/* ===== 图表容器 ===== */
.chart-container-financial {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-6);
    box-shadow: var(--shadow-sm);
    margin: var(--spacing-6) 0;
    position: relative;
    overflow: hidden;
}

.chart-container-financial::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color), var(--warning-color));
}

/* ===== 数字显示 ===== */
.number-display {
    font-weight: 700;
    font-size: var(--font-size-3xl);
    background: linear-gradient(135deg, currentColor, currentColor);
    -webkit-background-clip: text;
    background-clip: text;
    position: relative;
}

.number-display::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: linear-gradient(90deg, currentColor, transparent);
    border-radius: var(--border-radius);
}

/* ===== 加载动画 ===== */
.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-12);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-4);
}

.loading-text {
    color: var(--gray-500);
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== 警告框 ===== */
.alert-financial {
    border: none;
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-4) var(--spacing-6);
    font-weight: 500;
}

.alert-danger-financial {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert-success-financial {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-warning-financial {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

.alert-info-financial {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    color: var(--info-color);
    border-left: 4px solid var(--info-color);
}

/* ===== 微交互动画 ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    :root {
        --font-size-4xl: 1.875rem;
        --font-size-3xl: 1.5rem;
        --font-size-2xl: 1.25rem;
        --spacing-12: 2rem;
        --spacing-10: 2rem;
        --spacing-8: 1.5rem;
    }
    
    .metric-icon {
        width: 48px;
        height: 48px;
    }
    
    .metric-icon i {
        font-size: 1.5rem;
    }
    
    .stock-info-banner .card-body {
        padding: var(--spacing-8) var(--spacing-4);
    }
    
    .btn-financial {
        padding: var(--spacing-3) var(--spacing-4);
        font-size: var(--font-size-sm);
    }
}

/* ===== 可访问性优化 ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 焦点指示器 */
.btn-financial:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .card-financial {
        border-width: 2px;
    }
    
    .btn-financial {
        border: 2px solid currentColor;
    }
} 